		--Make the Minimap a Square
		Minimap:SetMaskTexture("Interface\\AddOns\\miirGui\\gfx\\Mask-SQUARE");
    function GetMinimapShape() return "SQUARE" end
		
		--Icon function
		local function Icon(arg1, arg2, arg3, arg4, arg5)
		local f = CreateFrame("Frame",nil,arg1)
		f:SetFrameStrata(arg5)
		f:SetWidth(64) 
		f:SetHeight(64)
		local t = f:CreateTexture(nil,"BACKGROUND")
		t:SetTexture("Interface\\AddOns\\miirGui\\gfx\\"..arg2)
		t:SetAllPoints(f)
		f.texture = t
		f:SetPoint("Topleft",arg3,arg4)
		f:Show() 		
		end
		
		--Adding Icon to the DressUpFrame
		Icon(DressUpFrame, "dress", 5, -4, "Medium")
		
		--Adding Icon to the MailFrames
		Icon(InboxFrame, "mail", 5, -4, "Medium")
		Icon(OpenMailFrame, "mail", 5, -4, "Medium")
		Icon(SendMailFrame, "mail", 7, -4, "Medium")
		
		--Adding Icon to the PvP-Pane
		Icon(PVPFrame, "pvp", -8, 9, "Medium")
		
		--Adding Icon to the Looking-For-Dungeon-Pane
		Icon(LFDParentFrame, "lfg", -8, 9, "Medium") 
		
		--Adding Icon to the Looking-For-Raid-Pane
		if select(4, GetBuildInfo()) >= 40300 then
		Icon(RaidParentFrame, "lfg", -8, 9, "Medium")
		RaidFinderFrameRoleBackground:Hide()
		end

		--Adding Icon to the FriendsFrame
		Icon(FriendsFrame, "friends", -8, 9, "Medium") 
	
		--Registering Addon Loading
		local frame = CreateFrame("FRAME");
		frame:RegisterEvent("ADDON_LOADED")
		function frame:OnEvent(event, arg1)
		
		
		--Adding Icon to the EncounterJournalFrame
		if event == "ADDON_LOADED" and arg1 == "Blizzard_EncounterJournal" and select(4, GetBuildInfo()) >= 40300 then	
		Icon(EncounterJournal, "journal", -8, 9, "Medium")
	
 		--Adding Icon to the Archaeology
		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_ArchaeologyUI" then	
		Icon(ArchaeologyFrame, "arch", -8, 9, "Medium")
		
		--Adding Icon to Reforging UI
		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_ReforgingUI" then	
		Icon(ReforgingFrame, "reforging", -8, 9, "Medium")
		_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,child23,child24,child25,child26,child27,child28 = ReforgingFrame:GetRegions();
		child23:SetTexture(0,0,0,0)
		child25:SetTexture(0.078,0.078,0.078,1)
		child24:SetTexture(0,0,0,0)
		child26:SetTexture(0,0,0,0)
		child27:SetTexture(0,0,0,0)
		child28:SetTexture(0,0,0,0)
		child1 = ReforgingFrameButtonFrame:GetRegions();
		child1:SetTexture(1,1,1,0)
		
		--Adding Icon to Transmo UI
		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_ItemAlterationUI" then	
		Icon(TransmogrifyFrame, "trans", -8, 9, "High")
		_, child2,_ = TransmogrifyModelFrame:GetRegions();
		child2:SetTexture(0,0,0,0)
		child1 = TransmogrifyFrameButtonFrame:GetRegions();
		child1:SetTexture(1,1,1,0)
		_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,child23 = TransmogrifyArtFrame:GetRegions();
		child23:SetTexture(1,1,1,0)
				--adding new background
				local bf = CreateFrame("Frame",nil,TransmogrifyFrame)
				bf:SetFrameStrata("Low")
				local bt = bf:CreateTexture(nil,"BACKGROUND")
				bt:SetTexture("Interface\\FrameGeneral\\UI-Background-Marble.blp")
				bt:SetAllPoints(bf)
				bf.texture = bt
				bf:SetPoint("Topleft",0,0)
				bf:SetPoint("Bottomright",0,0)
				bf:Show()
		
		
		--VoidStorage  Fixes
		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_VoidStorageUI" then	
		_, child2= VoidStorageFrame:GetRegions();
		child2:SetTexture(1,1,1,0)		
		VoidStorageDepositFrameBg:Hide()
		VoidStorageWithdrawFrameBg:Hide()
		VoidStorageStorageFrameLine1:SetTexture(0.08,0.342,0.52,1)
		VoidStorageStorageFrameLine1:SetWidth(1)
		VoidStorageStorageFrameLine2:SetTexture(0.08,0.342,0.52,1)
		VoidStorageStorageFrameLine2:SetWidth(1)
		VoidStorageStorageFrameLine3:SetTexture(0.08,0.342,0.52,1)
		VoidStorageStorageFrameLine3:SetWidth(1)
		VoidStorageStorageFrameLine4:SetTexture(0.08,0.342,0.52,1)
		VoidStorageStorageFrameLine4:SetWidth(1)
		
		--Achievement Fixes
		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_AchievementUI" then	
		AchievementFrameSummaryCategoriesCategory1FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory1Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesCategory2FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory2Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesCategory3FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory3Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesCategory4FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory4Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesCategory5FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory5Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesCategory6FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory6Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesCategory7FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory7Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesCategory8FillBar:Hide()
		AchievementFrameSummaryCategoriesCategory8Bar:SetVertexColor(0.08,0.342,0.52,1)
		AchievementFrameSummaryCategoriesStatusBarFillBar:Hide()
		AchievementFrameSummaryCategoriesStatusBarBar:SetVertexColor(0.08,0.342,0.52,1)

		--Adding Icon to the TrainerFrame	
		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_TrainerUI" then	
			local _, class = UnitClass("player")
			if class == "WARLOCK" then
				Icon(ClassTrainerFrame, "class_icons\\warlock", -8, 9, "Medium")
			end
			if class == "WARRIOR" then
				Icon(ClassTrainerFrame, "class_icons\\warrior", -8, 9, "Medium")
			end
			if class == "SHAMAN" then
				Icon(ClassTrainerFrame, "class_icons\\shaman", -8, 9, "Medium")
			end
			if class == "ROGUE" then
				Icon(ClassTrainerFrame, "class_icons\\rogue", -8, 9, "Medium")
			end		
			if class == "PRIEST" then
				Icon(ClassTrainerFrame, "class_icons\\priest", -8, 9, "Medium")
			end		
			if class == "PALADIN" then
				Icon(ClassTrainerFrame, "class_icons\\paladin", -8, 9, "Medium")
			end
			if class == "DRUID" then
				Icon(ClassTrainerFrame, "class_icons\\druid", -8, 9, "Medium")
			end
			if class == "HUNTER" then
				Icon(ClassTrainerFrame, "class_icons\\hunter", -8, 9, "Medium")
			end	
			if class == "MAGE" then
				Icon(ClassTrainerFrame, "class_icons\\mage", -8, 9, "Medium")
			end
			if class == "DEATHKNIGHT" then
				Icon(ClassTrainerFrame, "class_icons\\deathknight", -8, 9, "Medium")
			end
		
		--Adding Icon to the GuildFrame
		
 		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_GuildUI" then	
		factionGroup, factionName = UnitFactionGroup("player") -- Getting PlayerFaction
		if factionGroup == "Horde" then
			Icon(GuildFrame, "guildh", -8, 9, "High")
		elseif  factionGroup == "Alliance" then
			Icon(GuildFrame, "guilda", -8, 9, "High")  
		end
		
		--Adding Icon to the TalentFrame
	
		elseif event == "ADDON_LOADED" and arg1 == "Blizzard_TalentUI" then
		local _, class = UnitClass("player")

				local _, class = UnitClass("player")
			if class == "WARLOCK" then
				Icon(PlayerTalentFrame, "warlock", -8, 9, "Medium")
			end
			if class == "WARRIOR" then
				Icon(PlayerTalentFrame, "class_icons\\warrior", -8, 9, "Medium")
			end
			if class == "SHAMAN" then
				Icon(PlayerTalentFrame, "class_icons\\shaman", -8, 9, "Medium")
			end
			if class == "ROGUE" then
				Icon(PlayerTalentFrame, "class_icons\\rogue", -8, 9, "Medium")
			end		
			if class == "PRIEST" then
				Icon(PlayerTalentFrame, "class_icons\\priest", -8, 9, "Medium")
			end		
			if class == "PALADIN" then
				Icon(PlayerTalentFrame, "class_icons\\paladin", -8, 9, "Medium")
			end
			if class == "DRUID" then
				Icon(PlayerTalentFrame, "class_icons\\druid", -8, 9, "Medium")
			end
			if class == "HUNTER" then
				Icon(PlayerTalentFrame, "class_icons\\hunter", -8, 9, "Medium")
			end	
			if class == "MAGE" then
				Icon(PlayerTalentFrame, "class_icons\\mage", -8, 9, "Medium")
			end
			if class == "DEATHKNIGHT" then
				Icon(PlayerTalentFrame, "class_icons\\deathknight", -8, 9, "Medium")
			end
			
			--Adding Icon to the TradeSkillFrame	
			elseif event == "ADDON_LOADED" and arg1 == "Blizzard_TradeSkillUI" then	
			Icon(TradeSkillFrame, "trade", -8, 9, "Medium")
			end
	
end
frame:SetScript("OnEvent", frame.OnEvent);
